import sys
import compiler
import decompiler
import runner

argv = sys.argv[1:]

if len(argv) < 2:
    print('Missing parameters')
    sys.exit()

if argv[0] == 'compile':
    try:
        compiler.compile(argv[1], argv[2] == 'true')
    except IndexError:
        compiler.compile(argv[1], False)
elif argv[0] == 'decompile':
    decompiler.decompile(argv[1])

elif argv[0] == 'run':
    runner.run(argv[1])
